com.highdeal.pnr.hci
Class OutMacroPropertyModel

java.lang.Object
  extended by com.highdeal.pnr.hci.OutMacroPropertyModel
All Implemented Interfaces:
XMLMarshallable

public class OutMacroPropertyModel
extends java.lang.Object
implements XMLMarshallable

This class represents an output property of a pricing macro and contains a name, a description, a type and a default value. The type of an output property must be string, number, or date.

See Also:
PricingMacroModel

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="outProperty">
   <xs:complexType>
     <xs:attribute name="name" type="xs:string"/>
     <xs:attribute name="defaultValue" type="xs:string"/>
     <xs:attribute name="type" type="xs:string"/>
     <xs:attribute name="description" type="xs:string"/>
   </xs:complexType>
 </xs:element>


Constructor Summary
OutMacroPropertyModel()
          Constructs an empty output property model.
OutMacroPropertyModel(java.lang.String name, java.lang.String description, int type)
          Constructs an output property with a name, a description and a type.
OutMacroPropertyModel(java.lang.String name, java.lang.String description, int type, java.lang.Object defaultValue)
          Constructs an output property with a name, a description, a type and a default value.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 boolean checkValidity()
          Returns true if the property is valid.
 java.util.Date getDateValue()
          Gets the default value of the output property as a date.
 java.lang.Object getDefaultValue()
          Gets the default value of the output property.
 java.lang.String getDescription()
          Returns the description of the output property.
 java.lang.String getName()
          Returns the name of the output property.
 java.math.BigDecimal getNumberValue()
          Gets the default value of the output property as a decimal.
 java.lang.String getStringValue()
          Gets the default value of the output property as a string.
 int getType()
          Gets the type of the output property.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setDefaultValue(java.lang.Object defaultValue)
          Sets the default value of the output property.
 void setDescription(java.lang.String d)
          Sets the description of the output property.
 void setName(java.lang.String n)
          Sets the name of the output property.
 void setType(int t)
          Sets the type of the output property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutMacroPropertyModel

public OutMacroPropertyModel()
Constructs an empty output property model.


OutMacroPropertyModel

public OutMacroPropertyModel(java.lang.String name,
                             java.lang.String description,
                             int type,
                             java.lang.Object defaultValue)
Constructs an output property with a name, a description, a type and a default value. (see setType(int) for allowed type value)

Parameters:
name - the name of the output property.
description - the description of the output property.
type - the type of the output property.
defaultValue - the default value of the output property.

OutMacroPropertyModel

public OutMacroPropertyModel(java.lang.String name,
                             java.lang.String description,
                             int type)
Constructs an output property with a name, a description and a type. (see setType(int) for type allowed value)

Parameters:
name - the name of the output property.
description - the description of the output property.
type - the type of the output property.
Method Detail

getName

public java.lang.String getName()
Returns the name of the output property.

Returns:
the name of the output property.

setName

public void setName(java.lang.String n)
Sets the name of the output property.

Parameters:
n - the name of the output property.

getDescription

public java.lang.String getDescription()
Returns the description of the output property.

Returns:
the description of the output property.

setDescription

public void setDescription(java.lang.String d)
Sets the description of the output property.

Parameters:
d - the description of the output property.

getType

public int getType()
Gets the type of the output property. Returned values are :

Returns:
the type of the output property.

setType

public void setType(int t)
Sets the type of the output property. Allowed values are :

Parameters:
t - the type of the output property.

getDefaultValue

public java.lang.Object getDefaultValue()
Gets the default value of the output property.

Returns:
the default value of the output property.

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)
Sets the default value of the output property.

Parameters:
defaultValue - the default value of the output property.

getStringValue

public java.lang.String getStringValue()
Gets the default value of the output property as a string.

Returns:
the default value of the output property, or null if the default value is not a string.

getNumberValue

public java.math.BigDecimal getNumberValue()
Gets the default value of the output property as a decimal.

Returns:
the default value of the output property, or null if the default value is not a decimal.

getDateValue

public java.util.Date getDateValue()
Gets the default value of the output property as a date.

Returns:
the default value of the output property, or null if the default value is not a date.

checkValidity

public boolean checkValidity()
Returns true if the property is valid. Property is valid if its name is not null or empty, and if its default value is valid according to the specified type (see setType(int)).

Returns:
true if the property is valid, false otherwise.

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the element being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - The name of tag for the child
child - The child to be added

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)